package com.udian.frame.common;

import java.io.Serializable;

/**
 * 
 * @Description  订单系统内部异常
 * 
 * @Project order-center  
 * @author <a href="fairwork@163.com">zhu.wd</a>
 * @date 2016年5月19日 下午5:17:08 
 * @version 1.0   
 * @since JDK 1.7
 */
public class BizException  extends RuntimeException implements Serializable {
    private static final long serialVersionUID = 1L;

    private Result<?> result = null;
    private Exception exception;
    
    
    public BizException(Result<?> result,String errMsg,Exception exception) {
        super(errMsg);
        this.result = result;
        this.exception = exception;
    }
    
    
    public BizException(Result<?> result,String errMsg) {
        super(errMsg);
        this.result = result;
    }
    
    public <T> BizException(ResultCode resultCode,T t,String errMsg) {
        super(errMsg);
        this.result = new Result<T>(resultCode.getCode(),resultCode.getMsg(),t);
    }
    
    public <T> BizException(ResultCode resultCode,T t) {
        super(resultCode.getMsg());
        this.result = new Result<T>(resultCode.getCode(),resultCode.getMsg(),t);
    }
    
    public BizException(int code,String msg,String errMsg) {
        super(errMsg);
        this.result = new Result(code,msg);
    }
    
    public <T> BizException(int code,String msg,T t,String errMsg) {
        super(errMsg);
        this.result = new Result<T>(code,msg,t);
    }
    
    public <T> BizException(int code,String msg,T t) {
        super(msg);
        this.result = new Result<T>(code,msg,t);
    }
    
    public BizException(ResultCode resultCode,String errMsg) {
        super(errMsg);
        this.result = new Result(resultCode);
    }
    
    public BizException(int code ,String errMsg) {
        super(errMsg);
        this.result = new Result(code,errMsg);
    }
    
    public BizException(ResultCode resultCode) {
        super(resultCode.getMsg());
        this.result = new Result(resultCode);
    }
    
    public BizException(Result<?> result) {
        super();
        this.result = result;
    }
    
    
    
    public <T> BizException(ResultCode resultCode,T t,String errMsg,Exception exception) {
        super(errMsg);
        this.result = new Result<T>(resultCode.getCode(),resultCode.getMsg(),t);
        this.exception = exception;
    }
    
    public <T> BizException(ResultCode resultCode,T t,Exception exception) {
        super(resultCode.getMsg());
        this.result = new Result<T>(resultCode.getCode(),resultCode.getMsg(),t);
        this.exception = exception;
    }
    
    public BizException(int code,String msg,String errMsg,Exception exception) {
        super(errMsg);
        this.result = new Result(code,msg);
        this.exception = exception;
    }
    
    public <T> BizException(int code,String msg,T t,String errMsg,Exception exception) {
        super(errMsg);
        this.result = new Result<T>(code,msg,t);
        this.exception = exception;
    }
    
    public <T> BizException(int code,String msg,T t,Exception exception) {
        super(msg);
        this.result = new Result<T>(code,msg,t);
        this.exception = exception;
    }
    
    public BizException(ResultCode resultCode,String errMsg,Exception exception) {
        super(errMsg);
        this.result = new Result(resultCode);
        this.exception = exception;
    }
    
    public BizException(int code ,String errMsg,Exception exception) {
        super(errMsg);
        this.result = new Result(code,errMsg);
        this.exception = exception;
    }
    
    public BizException(ResultCode resultCode,Exception exception) {
        super(resultCode.getMsg());
        this.result = new Result(resultCode);
        this.exception = exception;
    }
    
    public BizException(Result<?> result,Exception exception) {
        super();
        this.result = result;
        this.exception = exception;
    }
    
    
    public Result<?> getResult() {
        return result;
    }

    public void setResult(Result<?> result) {
        this.result = result;
    }

    public Exception getE() {
        return exception;
    }

    public void setE(Exception e) {
        this.exception = e;
    }
}